#include <stdio.h>

int main(int argc, char *argv[])
{
	int x1, y1, x2, y2, t;
	int x, y;

	scanf("%d %d %d %d", &x1, &y1, &x2, &y2);

	if (y1 > x1) {t = x1; x1 = y1; y1 = t;}
	if (y2 > x2) {t = x2; x2 = y2; y2 = t;}
	
	x = x1 > x2 ? x1 : x2;
	y = y1 > y2 ? y1 : y2;

	printf("%d %d\n", x, y);

	return 0;
}
